home *** CD-ROM | disk | FTP | other *** search
- /*
- OPAL ADD PHOTOS TO BACKGROUND
- By J.L. White
- ©1994 Merlin's Software
-
- Add Image & Resize To Fit Then Place In Photo On Background
- Opal Paint Script
-
- Batch Factory Batch Conversion Scripts are basically Arexx scripts that
- allow you to pass certain parameters to the external program you wish
- to use to convert the images from one format to another. You can pass
- five different strings from Batch Factory to the script by using the
- following commands:
-
- $N = This will pass the current selected filename.
- $P = This will tell Batch Factory to ask for a path to save new frames to.
- $# = This will pass the current frame number in the script.
- $T = This will pass the total number of frames in the script.
- $A = This will pass an offset number to be used to save frames with.
-
- NOTE: The following line is required to work as a Batch Factory Script:
-
- PARSE=$N $P $# $A $T
-
- */
-
- options results
- call Locate_OpalPaint
- address "OpalPaint_Rexx"
- Num = 6
- arg InPic OutPic FrameNum AddNum TotalNum
- SaveNum = FrameNum + AddNum
- if FrameNum = 1 then do
- SaveSetUp
- SetPrefs 1024
- AskBool "Select Save Format You Wish To Use?\n\n Select [OK] For IFF \n\n Select [CANCEL] For JPEG"
- if Result=0 then do
- AskProp 1 100 84 "Enter JPEG Compression Value (1 - 100)!"
- Format = JPEG Result
- end
- else
- Format = IFF
- Saver Format
- AddPage 640 400 HIRES INTERLACE
- Key "j"
- AskFileName 'Select Background Image To Use! RAM: '
- Load result
- CurrPage
- PageNum = result
- SecondaryPage PageNum
-
- PageSize
- Parse var Result Width Height
- X1 = Width%Num
- X2 = Width - (Width%Num)
- Y1 = Height%Num
- Y2 = Height - (Height%Num)
- key "F10"
- key "."
- SetPot 1 255 255 255
- ActivePot 1
- ColourSource PAINTPOT
- SetDrawMode 3 25
- AddX = 5
- if Width > 400 then AddX = 10
- AddY = 5
- if Height > 300 then AddY = 10
- SolidRect X1+10 Y1+10 X2+AddX Y2+AddY
- SetDrawMode 1
- SolidRect X1 Y1 X2 Y2
- key "F10"
- Key "j"
- call open TempFile,"Ram:OAITB",W
- call writeln TempFile,X1
- call writeln TempFile,Y1
- call writeln TempFile,X2
- call writeln TempFile,Y2
- call close TempFile
- end
- else do
- call open TempFile,"Ram:OAITB",R
- line = readln(TempFile)
- parse var line X1
- line = readln(TempFile)
- parse var line Y1
- line = readln(TempFile)
- parse var line X2
- line = readln(TempFile)
- parse var line Y2
- call close TempFile
- end
- Load InPic
- ActiveBrush 1
- SetDrawMode 1
- PageSize
- Parse var Result Width Height
- RectCut 0 0 Width Height
- RescaleMethod Smooth1
- Resize (X2-X1)-12 (Y2-Y1)-10
- Key "j"
- SetDrawMode 1
- ActiveBrush 1
- ColourSource MULTICOLOR
- Handle 0 0
- PutBrush X1+7 Y1+6
- if OutPic = "SAME" then
- Save InPic
- else
- Save OutPic""right(SaveNum,3,0)
- Key "j"
- if FrameNum = TotalNum then do
- Key "."
- SecondaryPage
- DeletePage result
- RestoreSetUp
- Key "AMIGA w"
- address command "wait 1"
- address command "Delete >NIL: RAM:OAITB"
- end
- exit
-
- Locate_OpalPaint:
- if (POS('OpalPaint_Rexx',SHOW('Ports')) = 0)
- then do
- address command 'run < nil: > nil: OpalPaint:OpalPaint -q'
- address command 'wait 5'
- end
- return
-